 |
 PICKLISTCOLLECTION in LotusScript - unique values only? ~Judy Umjumiskiakoi 02/27/2007 04:31 PM Applications Development 7.0.2 All Platforms
Hello. Here is some LotusScript code I have written. Is there any way to do a Unique on this view so that the user doesn't see any duplicate entries? This PickListCollection uses a view that may contain one person's name dozens of times in that list, but I only want the user to see each person's name once.
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim dc_Employee As NotesDocumentCollection
Set db_Current = s.CurrentDatabase
Set dc_Employee = ws.PickListCollection( 3, False, db_Current.server, db_Current.FilePath, _
"V_LK_REGBYEMP", "Choose employee", "Choose the employee whose name has changed.")
Alternatively, I have some code that successfully gets all the names from each document in the database and trims them perfectly - however, how do I prompt the user from a LotusScript agent using these choices? It's easy to do in a combobox but the agent has no such field choices like a form... anyway here is the code. It returns an array, but how do I give this array to the user and let them choose one string (a name) from the array?
Dim EmpValues As Variant
EmpValues = Evaluate(|@Trim(@Unique(@DbColumn("":"NoCache";"";"V_LK_REGBYEMP";1)))|)
EmpOldName = Cstr(EmpValues(0))
If EmpOldName = "" Then
Messagebox "Cancelling operation: no user chosen."
Exit Sub
End If
Thanks for reading!
Trish
Go back |